#include "hall.h"
#include "zf_gpio.h"

void Hall_Init(void)
{
    // 设置为高阻输入
    gpio_mode(P0_2, GPI_IMPEDANCE);
    gpio_mode(P0_3, GPI_IMPEDANCE);
    //霍尔上升沿触发，漫反射下降沿触发
    P0IM0 = 0x04;
    P0IM1 = 0x00;
    // 清除标志位并开启使能
    P0INTF = 0x00;
    P0INTE = 0x0C;
}